package cn.edu.xmu.javaee.chapter2.beandefinition;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

@Configuration
public class BeanConfig {

    @Bean
    @Scope("singleton")
    public PaymentService paymentService(AliPayAdaptor aliPayAdaptor) {
        return new PaymentService(aliPayAdaptor);
    }
}
